import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from 'src/entities/base.entity';

@Entity()
export class Dept extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'bigint',
  })
  dept_id: number;

  @Column({
    type: 'varchar',
    length: 50,
    comment: '部门名称',
  })
  dept_name: string;

  @Column({
    type: 'bigint',
    default: 0,
    comment: '父部门id',
  })
  parent_id: number;

  @Column({
    type: 'int',
    default: 0,
    comment: '显示顺序',
  })
  order_num: number;

  @Column({
    type: 'varchar',
    length: 50,
    nullable: true,
    comment: '部门负责人',
  })
  leader: string;

  @Column({
    type: 'varchar',
    length: 200,
    nullable: true,
    comment: '邮箱',
  })
  email: string;

  @Column({
    type: 'varchar',
    length: 11,
    nullable: true,
    comment: '联系电话',
  })
  phone: string;

  @Column({
    type:"char",
    nullable:true,
    length:1,
    default:'0',
    comment:"部门状态（0正常 1停用）"
  })
  status: string;
}
